home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / solaris2 / jdk / src / java / awt / test / flowtest.jav < prev    next >
Encoding:
Text File  |  1995-10-30  |  1.7 KB  |  54 lines

  1. /*
  2.  * @(#)FlowTest.java    1.8 95/07/30 Arthur van Hoff
  3.  *
  4.  * Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. import java.awt.*;
  21.  
  22. class FlowPanel extends Panel {
  23.     FlowPanel(int align) {
  24.     setLayout(new FlowLayout(align));
  25.     add(new Button("een"));
  26.     add(new Button("twee"));
  27.     add(new Button("drie"));
  28.     add(new Button("vier"));
  29.     add(new Button("vijf"));
  30.     add(new Button("zes"));
  31.     add(new Button("zeven")).hide();
  32.     add(new Button("acht"));
  33.     add(new Button("negen"));
  34.     add(new Button("tien"));
  35.     add(new Button("elf"));
  36.     }
  37. }
  38.  
  39. class FlowTest extends Frame {
  40.     FlowTest() {
  41.     setFont(new Font("Dialog", Font.PLAIN, 18));
  42.     setLayout(new BorderLayout());
  43.     add("North", new FlowPanel(FlowLayout.LEFT)).setBackground(new Color(255, 200, 150));
  44.     add("Center", new FlowPanel(FlowLayout.CENTER)).setBackground(new Color(200, 255, 150));
  45.     add("South", new FlowPanel(FlowLayout.RIGHT)).setBackground(new Color(200, 100, 255));
  46.     pack();
  47.     show();
  48.     }
  49.  
  50.     public static void main(String argv[]) {
  51.     new FlowTest();
  52.     }
  53. }
  54.